<?php

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/8/20
 * Time: 15:24
 */
class 过虑禁用字符入数据库前
{

}

//PHP过虑禁用字符，入数据库前（PHP代码函数）


function dowith_sql($str)
{
    $str = str_replace("and","",$str);
    $str = str_replace("execute","",$str);
    $str = str_replace("update","",$str);
    $str = str_replace("count","",$str);
    $str = str_replace("chr","",$str);
    $str = str_replace("mid","",$str);
    $str = str_replace("master","",$str);
    $str = str_replace("truncate","",$str);
    $str = str_replace("char","",$str);
    $str = str_replace("declare","",$str);
    $str = str_replace("select","",$str);
    $str = str_replace("create","",$str);
    $str = str_replace("delete","",$str);
    $str = str_replace("insert","",$str);
    $str = str_replace("'","",$str);
    $str = str_replace("\"","",$str);
   $str = str_replace(" ","",$str);
   $str = str_replace("or","",$str);
   $str = str_replace("=","",$str);
   $str = str_replace("%20","",$str);
   //echo $str;
   return $str;
}


$str = str_replace("and","&#97;nd",$str);
$str = str_replace("execute","&#101;xecute",$str);
$str = str_replace("update","&#117;pdate",$str);
$str = str_replace("count","&#99;ount",$str);
$str = str_replace("chr","&#99;hr",$str);
$str = str_replace("mid","&#109;id",$str);
$str = str_replace("master","&#109;aster",$str);
$str = str_replace("truncate","&#116;runcate",$str);
$str = str_replace("char","&#99;har",$str);
$str = str_replace("declare","&#100;eclare",$str);
$str = str_replace("select","&#115;elect",$str);
$str = str_replace("create","&#99;reate",$str);
$str = str_replace("delete","&#100;elete",$str);
$str = str_replace("insert","&#105;nsert",$str);
$str = str_replace("'","&#39;",$str);
$str = str_replace("\"","&#34;",$str);